﻿using System;
using System.Collections.Generic;
using DC2010.Objects.Base;
using DC2010.Objects.Common;

namespace DC2010.Objects.Data
{
    [Serializable]
    public class ItemData : BaseData
    {
        public ItemData()
        {
        }

        /// <summary>
        /// List of items in container
        /// </summary>
        public Inventory ContainerItems { get; set; }

        /// <summary>
        /// The base number used to calculate how much damage your attack does.
        /// </summary>
        public int Damage { get; set; }

        /// <summary>
        /// This value determines how far the item will go when thrown.
        /// If a weapon is used to "Shoot", this will be a part of how far the item being shot will travel. 
        /// The farther the projectile goes, the more damage it does (Damage is decreased as it flies).
        /// </summary>
        public int Distance { get; set; }

        /// <summary>
        /// This indicates that scroll in inventory will be displayed
        /// </summary>
        public string ItemMessage { get; set; }

        public List<string> Combo { get; set; }

        public Inventory SocketedItems { get; set; }

        public ItemGfx Gfx
        {
            get
            {
                if (!string.IsNullOrEmpty(GfxId))
                {
                    return Root.I.ItemSystem.GetGfx(GfxId);
                }

                return null;
            }
        }

        private ItemLogic _l;
        public ItemLogic L
        {
            get
            {
                if (_l == null)
                    _l = new ItemLogic(this);

                return _l;
            }
        }
    }
}
